package com.tk.exam.vo.paper;

import com.tk.exam.domain.TkQuestions;
import com.tk.exam.domain.TkRPaperQuestion;
import com.tk.exam.vo.question.*;
import com.tk.exam.vo.question.resp.TkQuestion4CRespVo;
import lombok.Data;

import java.util.List;
import java.util.Map;
import java.util.Objects;

@Data
public class GetStuFourCQAResp {
    private int sortIndex;
    private String quesTitle;
    //存在缺陷 1：是0：否
    private String hasDefect;
    //备选类型
    private List<Option> options;
    //4种图片
    private List<SupportDeviceImage> supportDeviceImages;
    private List<CatenaryImage> catenaryImages;
    private List<AddSuspensionImage> addSuspensionImages;
    private List<DavitImage> davitImages;

    public GetStuFourCQAResp(TkRPaperQuestion tkRPaperQuestion, TkQuestion4CRespVo tkQuestion4CRespVo,TkQuestion4CRespVo question){
        setSortIndex(tkRPaperQuestion.getSortIndex());
        setQuesTitle(question.getQuesTitle());
        setHasDefect(Objects.nonNull(tkQuestion4CRespVo)?tkQuestion4CRespVo.getHasDefect():question.getHasDefect());
        setSupportDeviceImages(Objects.nonNull(tkQuestion4CRespVo)?tkQuestion4CRespVo.getSupportDeviceImages():question.getSupportDeviceImages());
        setCatenaryImages(Objects.nonNull(tkQuestion4CRespVo)?tkQuestion4CRespVo.getCatenaryImages():question.getCatenaryImages());
        setAddSuspensionImages(Objects.nonNull(tkQuestion4CRespVo)?tkQuestion4CRespVo.getAddSuspensionImages():question.getAddSuspensionImages());
        setDavitImages(Objects.nonNull(tkQuestion4CRespVo)?tkQuestion4CRespVo.getDavitImages():question.getDavitImages());
        setOptions(Objects.nonNull(tkQuestion4CRespVo)?tkQuestion4CRespVo.getOptions():question.getOptions());
    }

}
